Open Bug 516222 Opened 16 years ago Updated 3 years ago

Message filter marks messages as read on move (Gmail IMAP)

Categories

(MailNews Core :: Filters, defect)

x86_64
All
defect

Tracking

(Not tracked)

People

(Reporter: piratmac, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [gs])

Attachments

(3 files)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.1.3) Gecko/20090909 Fedora/3.5.3-1.fc11 Firefox/3.5.3 Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090901 Shredder/3.0b4pre Hello, I'm using Thunderbird with IMAP Gmail. I have multiple filters based on the subject of the mail, and they are told to move the message (and only that). If I recieve messages corresponding to any filter, it is moved to the folder, BUT it also marks the message as read. Same action if I manually run the filter. Thanks, Piratmac Reproducible: Always Steps to Reproduce: 1. Create a folder 2. Create a filter with only a "Move to folder" action 3. Send yourself a mail matching the filter Actual Results: The message is marked as read. Expected Results: The message not marked as read. I use default theme. I have been forced to use Shredder because of another bug (https://bugzilla.mozilla.org/show_bug.cgi?id=506095).
What precise date of build are you using? I ask because there were a couple of bugs landed on 2009-09-09 and 2009-09-10 that might have afected this (hopefully for the better, but there is always a risk of regressions.)
I think it is the 2009-09-01 build (I have a tar.gz from this date, and bug 506095 has been solved on that date)
Perhaps this is obvious, but it would be helpful if you could test this with a currently nightly build to see if your symptoms were affected by the bugs that landed after your current build. Those bugs were directly aimed at problems with imap-to-local moves flags Read and New, particularly bug 389098.
(In reply to comment #2) > I think it is the 2009-09-01 build (I have a tar.gz from this date, and bug > 506095 has been solved on that date) If you go to help -> about, you'll get the full version string there, that is what is most helpful to us.
(In reply to comment #4) > (In reply to comment #2) > > I think it is the 2009-09-01 build (I have a tar.gz from this date, and bug > > 506095 has been solved on that date) > > If you go to help -> about, you'll get the full version string there, that is > what is most helpful to us. In fact, I have already done that : > Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090901 Shredder/3.0b4pre I'll test a more recent build later (probably tomorrow), thanks for the idea ;)
Confirmed with yesterday's build (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090914 Shredder/3.0b4pre)
I tested this on three different types of moves (imap-> local, imap->same imap server, imap->different imap server) and they all worked for me. So we need to figure out what is different in your environment. Can you tell me precisely what kind of accounts you are moving from, and moving to? Also, it would be helpful if you could create a new profile, just add the minimum accounts and filters necessary to reproduce the bug, and confirm that the bug still occurs on a new profile.
I have a Gmail account set with IMAP. I have many folders and subfolders. My filter is set to move a mail from INBOX to INBOX/folder1 or INBOX/folder2 according to the subject of the mail, that's all. Mails are marked as read during the transfer :/ I'll try to set a new profile this evening.
OS: Linux → All
The two new dups are both, AFAIU, TB2 bugs, so I doubt if they are the same underlying issue. Much has changed here from TB2 to TB3. But I took the opportunity of the new dups to recheck this, and I still cannot verify it. This time I tried a Gmail account. If this is a real issue, I would be happy to investigate and fix, but I cannot make progress without some more help in narrowing down the conditions so that I can reproduce.
I have recently moved to TB3 (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0), and I still see this bug. I have removed and recreated one of the filter (as to test), and it has the same behavior.
Could you create an IMAP protocol log and post it here? See https://wiki.mozilla.org/MailNews:Logging
>(Bug summary) > Message filter marks messages as read on move Is there any evidence that "Message filter of Tb" marked the message as Read? Phenomenon is next, isn't it? - You use Gmail IMAP - You use "move to a folder" action for Inbox - Mail was marked as Read in move target folder AFAIK, Tb issues "fetch body.peek" like command by filter in order not to set \Seen flag, but Gmail IMAP seems to store \Seen flag upon it. AFAIR, I saw it in attached log to other bug. And, I saw log for next in attached log to another bug. - Tb issues store -Flag \Seen to a mail in a Gmail IMAP folder(a Gmail Label) - Tb issues copy for the mail of no \Seen flag - Gmail IMAP returns \Seen flag for the copied mail And, Tb3 enables auto-sync as default. AFAIK, auto-sync uses "fetch body.peek" like command, but Gmail IMAP may store \Seen flag upon the fetch. As Gmail keeps only single copy of mail data(externally, original is held in [Gmail]/All Mails), status such as \Seen/no-\Seen is held in the original mail data. Mail access of Gmail IMAP folder(==Gmail Label) via Gmail IMAP by an IMAP mail client(i.e Tb) may be affected by design/implementation and/or problem/restriction of Gmail/Gmail IMAP. (In reply to Comment #8) > Mails are marked as read during the transfer :/ If it's affected by particularity of Gmai/Gmail IMAP, I think your observation is right. To Piratmac(bug opener): Anyway, at least attach IMAP log to this bug as Kent James requests, please.
I hope I haven't removed too much (I have ~100 labels, and Thunderbird asks for each one...) The mmail subject contains "[Impulsion]" and was supposed to mode in INBOX/Imp, but in fact just disappeared...
Attached file Imap log of filtering
Attachment #418562 - Attachment mime type: application/octet-stream → text/plain
(In reply to comment #15) > I hope I haven't removed too much You didn't remove too much. You merely didin't do important thing - fetch of copied mail in Inbox/Imp. Get log for next please. (1) fetch of mails in Inbox/X (two mails to avoid other bug, both are Unread) (2) fetch of original in [Gmail]/All Mail (3) Move a mail from Inbox/X to Inbox/Imp (4) After move, fetch of original(single copy of mail) in [Gmal]/All Mail (5) fetch of copied mail to single copy of Inbox/Imp During test, show "Order Received" coulmn(UID of mail in a IMAP folder). It'll help your log check. > S-INBOX:SendData: 16 uid copy 10268 "INBOX/Imp" > S-INBOX:SendData: 17 uid store 10268 +FLAGS (\Deleted \Seen) > S-INBOX:CreateNewLineFromSocket: * 8 FETCH (FLAGS (\Seen \Deleted) UID 10268) > S-INBOX:CreateNewLineFromSocket: 17 OK Success Tb apparently doesn't(can't, because unable to know uid) store \Seen to copied mail in INBOX/Imp. After "store 10268 +Flags \Deleted \Seen", "\Seen may be propagated to single copy(original) of mail in [Gmail]/All Mail. If so, it's propagated to instances in other IMAP folders(Gmail Label) including INBOX/Imp. It may be reason why \Seen is set for instance in INBOX/Imp too.
What I did (as to be sure to have done the right thing) : - marked 2 messages as unread in INBOX/Ecole through the webmail - opened the folder INBOX/Ecole and [Gmail]/All Mail (ie [Gmail]/Tous les messages in French) in TB - moved one of the unread messages from INBOX/Ecole to INBOX/Imp [It marks the message as read before moving it] - opened [Gmail]/All Mail and INBOX/Imp I have anonymized some informations (like sender and subject of the mail) As far as I can understand this log, TB doesn't reload [Gmail]/All Mail when I click on it (I have deleted some lines at the end of the log, but none mentionned [Gmail]/All Mail
Attachment #418609 - Attachment mime type: application/octet-stream → text/plain
(In reply to comment #19) > Imap log of some operations (moving unread mail) There is no log for "copy to INBOX/Imp from INBOX/Ecole". (it was seen in previous log). You looks to have removed too much this time. Please attach log corresponds to your operation in Comment 18. As UID is different if different IMAP folder, please write down UID of moved mail in each IMAP folder. - UID in [Gmail]/All Mails (UID is not changed by move to INBOX/Imp from INBOX/Ecole) - UID in INBOX/Ecole (move source folder) - UID in INBOX/Imp (move target folder) As mail data itself is irrelevant if you write down UID in each folder correctly, remove log for mail data, please.
Blocks: tb-gmailWIP
Summary: Message filter marks messages as read on move → Message filter marks messages as read on move (Gmail IMAP)
Moved message has following UID : - 19260 in [Gmail]/All Mail - 3266 in INBOX/Imp - 920 in INBOX/Ecole
(In reply to comment #21) > New log of moving message Log says; Tb doesn't(can't) store \Seen flag to mail copied to "INBOX/Imp". > S-INBOX/Ecole:SendData: 22 uid copy 920 "INBOX/Imp" > S-INBOX/Ecole:CreateNewLineFromSocket: 22 OK [COPYUID 611828511 920 3266] (Success) > S-INBOX/Ecole:SendData: 23 uid store 920 +FLAGS (\Deleted \Seen) > S-INBOX/Ecole:CreateNewLineFromSocket: * 858 FETCH (FLAGS (\Seen \Deleted $MDNSent) UID 920) > S-INBOX/Ecole:CreateNewLineFromSocket: 23 OK Success > > S-INBOX/Ecole:SendData: 26 UID fetch 921:* (FLAGS) > S-INBOX/Ecole:CreateNewLineFromSocket: * 858 FETCH (UID 920 FLAGS (\Deleted $MDNSent \Seen)) > S-INBOX/Ecole:CreateNewLineFromSocket: 26 OK Success Tb fetches with BODY.PEEK. But Gmail IMAP returns \Seen for the copied mail to "INBOX/Imp". > S-INBOX/Imp:SendData: 7 UID fetch 3266 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type)]) > S-INBOX/Imp:CreateNewLineFromSocket: * 200 FETCH (UID 3266 RFC822.SIZE 12922 FLAGS ($MDNSent \Seen) BODY[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type)] {642} > S-INBOX/Imp:STREAM:OPEN Size: 12922: Begin Message Download Stream > S-INBOX/Imp:STREAM:CLOSE: Normal Message End Download Stream > S-INBOX/Imp:CreateNewLineFromSocket: 7 OK Success What can an IMAP mail client(Tb) do for "\Seen status for the copied mail to INBOX/Imp" in this case?
Do you have the Advanced IMAP Controls lab enabled in Gmail. If so, did you disable auto-expunge? That could be making a difference in the results.
Advances IMAP Controls is on, but auto-expunge off.
That probably explains it. Gmail does not maintain flags on a per-folder basis, so setting the \Seen flag anywhere marks the message as read everywhere. In its normal configuration, setting the \Deleted flag on a message removes the "current" label, and Gimap ignores any other flags being set on the same command. With auto-expunge disabled, Gmail does set the \Deleted flag for the "current" label, and does not ignore the other flags. Because Thunderbird is setting (\Deleted \Seen) when a message is moved, the message is getting marked as read.
(In reply to comment #25) > Advances IMAP Controls is on, but auto-expunge off. Piratmac, can you check with auto-expunge=on?
I seem to be having a similar problem except my server is using dovecot for imap and it's not only on messages that have been moved by the filter but also only tagged by the filter. It's also not happening on all emails. It seems to be happening on most junk mail that ends up not being marked as junk as well as some legitimate mail. I'm using tb 3.0.1 on linux and this never happened with tb2. I've got my imap account to not download messages (which seemed to solve it constantly marking read messages as unread) and like it said, it doesn't happen all the time. Most of the people I communicate with commonly it doesn't happen to while emails from people I don't communicate with often it happens to more often than not. It's also not just on messages that have been moved and not just on messages that have been tagged (or just on the combination of both). All my messages are either tagged or moved though so I can't tell if it's only on messages that are ran through the filter. This may be solved by setting up a filter that marks all messages as unread but I'm not sure how the filters work, it seems that once a message hits a move filter none of the following filters will affect it. I'll go ahead and try to set up that filter now though as a work around.
sorry, just noticed there's no filter action to mark a message as unread so i can't try out that work around.
(In reply to comment #29) > sorry, just noticed there's no filter action to mark a message as unread so i > can't try out that work around. My extension FiltaQuilla adds a mark as unread filter action. But as you said, the marking will happen before the message is moved, so it would not do much good.
was going to try it out anyways but it doesn't seem to be compatible with 3.0.1. Also probably not the most optimal place to mention it since it's not related to the bug but i've always thought it would be a good idea to be able to match when to and from are the same (rather than having to create a separate filter for ever forward you have).
(In reply to comment #31) > was going to try it out anyways but it doesn't seem to be compatible with > 3.0.1. > If by "it" you mean FiltaQuilla, it is valid through 3.1a1pre so should also be valid for 3.0.1. Anything else would be a bug that should be reported. > Also probably not the most optimal place to mention it since it's not related > to the bug but i've always thought it would be a good idea to be able to match > when to and from are the same (rather than having to create a separate filter > for ever forward you have). So you want to match specifically when the "From" email is contained in the list of "To" emails I presume. Not likely for Core, but a good application for FiltaQuilla. I'll add it to my wanted list. Back to the bug at hand, anything that you or anyone can do to create a reproducible test case for this would be greatly appreciated. It is really hard to fix a non-reproducible or intermittent bug.
Alright i've just noticed two things. I have almost identical filters for my imap account and local folders. First thing is a bug i've noticed since tb2. I have the following line for a filter: condition="AND (from,is,wo@i2net.com) AND (subject,contains,has been)" name="workorders complete" That seems to not usually catch those emails for some reason, I've since changed it to a single search word which works but i only remembered to change it for the Local Folders, so maybe that's the problem (that filter marks messages as read). So that could be the problem except that filter should have nothing to do with the emails getting marked as read. The second thing is again a difference between the imap and local folders filters. On the imap filters when i try to highlight a specific filter it just shows a highlight for the border of the filter, not over the entire filter. This doesn't happen on the Local Folders filter. This happened on the second to last filter. I just saved the filters file without modifying anything and now that problem has moved to one filter down. The second to last one which was had the problem prior to the save is a filter that would handle most the mails that get marked as read however there's no action to mark them as read. The one that it's currently happening on does mark them as read though. So here's the last 3 filter entries, the "unknown" filter is the one that it was happening to and the "website updates" filter is the one the highlight bug is currently happening to: name="i2net" enabled="yes" type="17" action="Move to folder" actionValue="imap://name%40narcopia.com@mail.direnetworks.com/i2net" condition="AND (to or cc,contains,name@i2net.com) AND (from,isn't,wo@i2net.com)" name="unknown" enabled="yes" type="17" action="Move to folder" actionValue="imap://name%40narcopia.com@mail.direnetworks.com/unknown" condition="AND (from,isn't in ab,moz-abmdbdirectory://abook.mab) AND (from,isn't in ab,moz-abmdbdirectory://history.mab)" name="website updates" enabled="yes" type="17" action="Move to folder" actionValue="imap://name%40narcopia.com@mail.direnetworks.com/i2net/updates" action="Mark read" condition="AND (to or cc,contains,wu@i2net.com)" I'm also going to start analyzing the emails that get marked as read so that hopefully i can see any sort of pattern they have.
As you have guessed, the Filtaquilla "mark as unread" had no effect : it marks the message as unread, THEN move it (and marking it as read) I tried to put "Advanced IMAP features" off, and it does the trick : messages are no longer marked as read while moving. I won't try to disable auto-expunge : I have too many mails, and I don't want to see any of them disappear (I use a custom Trash folder that doesn't delete mails, unlike GMail's one)
Component: General → Filters
Product: Thunderbird → MailNews Core
QA Contact: general → filters
Whiteboard: [gs]
Same problem running Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.0.
Same problem on both OSX and Windows XP
bug 619925 and bug 509423 are duplicates?? The later bug is confirmed, but this bug has more details.
Is there an add-on that is causing this? I inadvertently filed a duplicate of this bug a couple of days ago because the search engine is not smart enough to identify matching bugs, just common words. Are there any guidelines on how to research this? Is it possible that this is a Gmail server issue? I have done some scripting--JavaScript and DOS, and web pages--CSS and HTML, but my only programming experience was BASIC. How much of something like this was written in scripting and markup language, and how much written in C++? If there are so many people with issues of having email marked read when it should be unread, and so many having read mail marked unread, is there a common thread? Does this still need to be confirmed by a Mozilla programmer if so many people report the issue and it occurs at an apparently random point in time? Perhaps there is a "counter" bug in which this bug happens after so many iterations of running filters, moving email, or downloading emails.
Despite there being several people who have stated in the bug that they see this problem - that has been over a period of years, so I don't think this issue is at all common. Is comment 25 the key issue? FYI Piratmac, the reporter, no longer using Thunderbird
Wayne, Thanks for pointing out the bug for me. I'm looking into the matter. :-)
(In reply to Brian Kennelly from comment #24) > Do you have the Advanced IMAP Controls lab enabled in Gmail. If so, did you > disable auto-expunge? That could be making a difference in the results. FYI. Thunderbird uses "move" command(supported from Tb 3.3, see bug 636285). Because Gmail IMAP already supports "Move Extension", Tb uses "move" command for "filter move". Nedless to say, without \Seen flag request. > Log for Manual Run Filter on folder with action="move to a folder". > imap.gmail.com:S-Offline-Use-On-01:SendData: 78 uid move 55:56 "Offline-Use-On-02" Because now "move" is used instead of "copy & store +Flag \Deleted", auto-expunge=On or Off is logically irrelevant to flag status change upon filter move by Tb recently. And, because Tb still doesn't request \Seen flag when "move" is used for filter move, Tb still can't set \Seen flag by filter move, unless user requests other filter action what stores \Seen flag to moved mail.
I am joining this as I have marked Bug 803921 as a duplicate of this one. Can someone mark this as confirmed now?
(In reply to Thomas Sisson from comment #44) > I am joining this as I have marked Bug 803921 as a duplicate of this one. > Can someone mark this as confirmed now? With three duplicates now, I think it can indeed be regarded as confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I found a similar bug... very similar, so I comment this bug report. Message filter marks messages as read on FORWARD (but this does not happen on COPY). This happens on my boss'pc but not on mine (even if they have similar configuration and the same Thunderbird version (24) on WindowsXP). We do not use gmail, we have a mail server in the intranet. I suppose there is some old configuration survived to the various upgrade (my pc had a fresh install, one year ago). I suppose that if we delete thunderbird and preferences and make a fresh install, the issue may be resolved... but it is a long way. Reproducible: always create a new filter rule to match a specific email sender. The action is FORWARD to another email address. As result the message is marked as read. Expected result the message should be marked as unread (like it happens on my computer) Then, we added another action, to mark the message as unread, but the message remain marked as read. Then, we added another action to the same rule, to set a label for the message: it works as expected. Finally we made another rule, to mark the message as unread, and we set this rule as the last one. It had no effects: the new and forwarded message is still marked as read. I belive that the cause could be the same. Giacomo
Similar bug: After moving files by a Thunderbird filter from the IMAP inbox to a local Thunderbird folder, and then applying a "read" or "unread" status (which doesn't matter) to the moved e-mail, the status is always applied BOTH to the local copy AND to the server copy of the mail. Intended result: "read"/"unread" status should only be applied to the LOCAL mail copy if it is applied AFTER the move action.
Another very similar workflow: I have a filter for any mail whose "To" contains a particular email address to forward it to another address, move it to a subfolder, and mark as unread. TBird tells me that it will process as "forward", "mark unread", and then "move". When I log into TBird, it asks me for my incoming passwd. After submitting it, I can see an "unread" mail showing up in the specified sub-folder which then quickly is marked as read and almost immediately I am asked for a passwd for outgoing. I give it that and then the forward happens. As I have TBird set to always cc me on outgoing email, it shows up in my InBox as unread. I have multiple other filters that only move an email to a sub-folder and it is left as unread without my having to do anything, so it appears that the info in comment 46 about "the problem being 'forward'" is true. What seems to be happening is that all the rules in the filter are happening (verified in log) but the actual process of doing the forward has something occur after the rule has been completed and before it gets the confirm of my outgoing passwd that flips the email to read after it has been moved to the sub-folder and marked unread. I wonder if the forward has to be allowed to complete its actions before moving onto the next rule(s) which would then allow me to mark as unread so that the forwarding doesn't kill the unread which I, as a user, assume happens after the forwarding has done everything it needs to do? I am on OSX 10.9.5 (Mavericks) running Thunderbird 38.5.1 Thanks, Paul

What is the status of this bug? Last comment is 4 years old.
But the behaviour is still reproducable with TB 68.

But I am not sure if this is specific to the IMAP server.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: